<div class="footer">
    <div class="footer-content-top container-outer">
        <div class="footer-item">
            <div class="footer-item-top">
                <div class="footer-logo"><a href="{:addon_url('wwh/index/index')}"><img src="{$site.footer_logo|cdnurl}" alt=""></a></div>
            </div>
            <div class="footer-item-bottom">
                <div class="footer-contact">
                    <li>
                        <span class="font">{$site.tel}</span>
                    </li>
                    <li>
                        <span>邮箱：{$site.email}</span>
                    </li>
                    <li>
                        <span>地址：{$site.address}</span>
                    </li>
                </div>
            </div>
        </div>
        <div class="footer-item">
            <div class="footer-item-top">
                <div class="footer-link">链接导航</div>
            </div>
            <div class="footer-item-bottom">
                <div class="footer-nav">
                    {$site.content}
                </div>
            </div>
        </div>
        <div class="footer-item">
            <div class="footer-item-top">
                <div class="footer-link">更多媒体</div>
            </div>
            <div class="footer-item-bottom">
                <div class="footer-social">
                    <li>
                        <a href="javascript:;" class="click-message" title="客户留言">
                            <img src="__CDN__/assets/addons/wwh/images/message.png" class="img-center" alt="客户留言">
                        </a>
                    </li>
                    <li>
                        <a href="{$site.weibo}" target="_blank">
                            <img src="__CDN__/assets/addons/wwh/images/weibo.png" class="img-center" alt="微博">
                        </a>
                    </li>
                    <li>
                        <a>
                            <img src="__CDN__/assets/addons/wwh/images/wechat.png" class="img-center" alt="微信">
                        </a>
                        <div class="footer-img-show"><img src="{$site.wechat|cdnurl}" class="img-center"></div>
                    </li>
                    <li>
                        <a>
                            <img src="__CDN__/assets/addons/wwh/images/douyin.png" class="img-center" alt="抖音">
                        </a>
                        <div class="footer-img-show"><img src="{$site.douyin|cdnurl}" class="img-center"></div>
                    </li>
                    <li>
                        <a href="javascript:;" class="return-top" title="返回顶部">
                            <img src="__CDN__/assets/addons/wwh/images/top.png" class="img-center">
                        </a>
                    </li>
                </div>
            </div>
        </div>
    </div>
    <div class="footer-content-bottom">
        <div class="container-outer">
            <div class="footer-copy">{$site.copyright}<a href="{$site.link2}" rel="nofollow" target="_blank">{$site.beian}</a></div>
            <div class="footer-beian">
                <a href="{$site.link1}"><i><img src="__CDN__/assets/addons/wwh/images/beian.png" class="img-center"></i><span>{$site.gongwang}</span></a>
            </div>
        </div>
    </div>
</div>
<!-- 客户留言 -->
<div class="message-bg">
    <div class="message-wrapper">
        <div class="message-box">
            <form id="message" method="post">
                <div class="message-title">
                    <h5>留言咨询</h5>
                </div>
                <div class="message-list">
                    <div class="message-text">
                        <input type="text" placeholder="请输入您的姓名" name="realname" id="realname" autocomplete="on">
                    </div>
                    <div class="message-text">
                        <input type="text" placeholder="请输入您的电话" name="tel" id="tel" autocomplete="on">
                    </div>
                    <div class="message-text">
                        <input type="text" placeholder="请输入您的邮箱" name="email" id="email" autocomplete="on">
                    </div>
                    <div class="message-text ht">
                        <textarea name="content" id="content" placeholder="您期望了解的信息"></textarea>
                    </div>
                    <div class="verify-group">
                        <div class="message-text left">
                            <input type="text" placeholder="验证码" name="verify" id="verify" autocomplete="off">
                        </div>
                        <div class="verify-img right">
                            <img id="verifyImgs" src="{:addon_url('wwh/index/verify')}" onclick="this.src='{:addon_url('wwh/index/verify')}?seed='+Math.random()" />
                        </div>
                    </div>
                </div>
                <div class="message-subbox clearfix">
                    <div class="message-submit left">
                        <p>提交</p>
                    </div>
                    <div class="message-submit-text left">
                        <p>信息提交后，将有专人联系您！</p>
                    </div>
                </div>
            </form>
        </div>
        <div class="message-close">
            <img src="__CDN__/assets/addons/wwh/images/guanbi1.png" alt="" class="img1">
            <img src="__CDN__/assets/addons/wwh/images/guanbi2.png" alt="" class="img2">
        </div>
    </div>
</div>
<script src="__CDN__/assets/addons/wwh/js/layer/layer.js"></script>
<script type="text/javascript">
    //客户留言
    $(".message-submit").click(function(){
        var formdata = new FormData(document.getElementById("message"));
        var realname=$.trim($("#realname").val());
        var tel=$.trim($("#tel").val());
        var email=$.trim($("#email").val());
        var content=$.trim($("#content").val());
        var verify=$.trim($("#verify").val());
        if(realname==''){layer.alert('请填写姓名',{skin: 'layui-layer-lan' ,closeBtn: 0,title:"温馨提示：",icon:2,anim:2});return false;}
        if(tel==''){layer.alert('请填写电话',{skin: 'layui-layer-lan' ,closeBtn: 0,title:"温馨提示：",icon:2,anim:2});return false;}
        var reg=/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
        if(!reg.test(tel)){layer.alert('请填写有效的电话',{skin: 'layui-layer-lan' ,closeBtn: 0,title:"温馨提示：",icon:2,anim:2});return false;}
        if(email==''){layer.alert('请填写邮箱',{skin: 'layui-layer-lan' ,closeBtn: 0,title:"温馨提示：",icon:2,anim:2});return false;}
        var myreg =/^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
        if(!myreg.test(email)){layer.alert('请填写有效的邮箱',{skin: 'layui-layer-lan' ,closeBtn: 0,title:"温馨提示：",icon:2,anim:2});return false;}
        if(content==''){layer.alert('请填写留言内容',{skin: 'layui-layer-lan' ,closeBtn: 0,title:"温馨提示：",icon:2,anim:2});return false;}
        if(verify==''){layer.alert('请填写验证码',{skin: 'layui-layer-lan' ,closeBtn: 0,title:"温馨提示：",icon:2,anim:2});return false;}

        //重载验证码
        function fleshVerify(){
            $('#verifyImgs').attr('src','{:addon_url('wwh/index/verify')}?seed='+Math.random());
        }

        $.ajax({
            url: "{:addon_url('wwh/index/message')}",
            type: "POST",
            data:formdata,
            cache:false,
            async:false,
            contentType: false,
            processData: false,
            dataType:"json",
            success: function(mes){
                if(mes==1){
                    alert("提交成功");
                    window.location.reload();
                }else if(mes==2){
                    layer.alert('请检查后台邮件配置是否正确',{skin: 'layui-layer-lan' ,closeBtn: 0,title:"温馨提示：",icon:2,anim:2});
                    fleshVerify();
                }else {
                    layer.alert('验证码错误，请重试',{skin: 'layui-layer-lan' ,closeBtn: 0,title:"温馨提示：",icon:2,anim:2});
                    fleshVerify();
                }
            }
        })
    })
</script>
